﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinformTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public Label Form2Lable
        {
            get;
            set;
        }

        //public event EventHandler<TransEventArgs> changeValueEventHanler;

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = "Hello world";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            // Form2Lable.Text = DateTime.Now.ToString();
            //AppData.LableTrans.Text = DateTime.Now.ToString();
            TransEventArgs transEventArgs = new TransEventArgs
            {
                TransValue = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
            };
            AppData.Instance.TransEventHandler(transEventArgs);
        }


        private void Form1_Load(object sender, EventArgs e)
        {
            new Form2()
            {
                ShowValue = "123456789101112"
            }.Show();
        }


        ParentClas ParentClas = new ParentClas();
        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.Text = ParentClas.Plus1Method().ToString();
        }

        SonClass SonClass = new SonClass();
        private void button4_Click(object sender, EventArgs e)
        {
            textBox2.Text = SonClass.NewPlus2Method().ToString();
        }
    }
}
